#! /usr/bin/python3
# coding=utf-8
# @Time: 2023/11/14 11:00 上午
# @Author: william

from base.TopMenuBase import TopMenuBase
from base.ObjectMap import ObjectMap
from selenium.webdriver.common.by import By


class TopMenuPage(TopMenuBase, ObjectMap):

    def mouse_hover_right_top_user_avatar(self, driver):
        user_avatar_xpath = self.right_top_user_avatar()
        return self.mouse_hover(driver, By.XPATH, user_avatar_xpath)

    def click_dropdown_menu(self, driver, menu_name):
        menu_xpath = self.dropdown_menu(menu_name)
        return self.element_click(driver, By.XPATH, menu_xpath)
